package com.yunfei.yunmusic.web.control;

import com.yunfei.yunmusic.web.model.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class CommentControl {
@Autowired
    private CommentPostControl commentPostControl;

    @RequestMapping(path="/comments")
    public String comments(ModelMap modelMap){
        List<Comment> comments=commentPostControl.getComments("1346104327");
            modelMap.addAttribute("comments",comments);

        return "comments";
    }

}
